class Image < ActiveRecord::Base
  attr_accessible :name, :image, :description, :product_id, :delete_image
  belongs_to :product, :inverse_of => :images


  has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }
  attr_accessor :delete_image
  before_validation { self.image.clear if self.delete_image == '1' }
end
